<template>
  <div class="app-container">
    <el-form :inline="true" ref="ruleForm" :model="formInline">
      <el-form-item  prop="time" label="变更时间">
            <el-date-picker
              v-model="formInline.time"
              type="datetimerange"
              align="right"
              unlink-panels
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :default-time="['00:00:00', '23:59:59']"
              value-format="yyyy-MM-dd HH:mm:ss"
              :picker-options="pickerDayStep">
            </el-date-picker>
      </el-form-item>
      <el-form-item label="账户名" prop="username">
        <el-input v-model="formInline.username"></el-input>
      </el-form-item>
      <el-form-item label="记录类型" prop="modifyType">
        <el-select v-model="formInline.modifyType">
          <el-option label="全部" value="-1"></el-option>
          <el-option label="手机号" value="0"></el-option>
          <el-option label="邮箱" value="1"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="手机号/邮箱" prop="content">
        <el-input v-model="formInline.content"></el-input>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="formInline.status">
          <el-option label="全部" value="-1"></el-option>
          <el-option label="使用中" value="1"></el-option>
          <el-option label="已删除" value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-button
        class="filter-item"
        type="primary"
        :loading="loading"
        icon="el-icon-search"
        @click="handleFilter"
      >
        搜索
      </el-button>
      <el-button @click="selfResetForm('ruleForm')">重置</el-button>
    </el-form>
  </div>
</template>

<script>
import { form, pickerOption, grid } from '@/build';

export default {
  name: 'phoneAndEmailFilter',
  mixins: [form, pickerOption, grid],
  data() {
    return {
      formInline: {
        userType: 1,
        dateType: 2,
        time: [moment().format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 23:59:59')],
        username: '',
        modifyType: '-1',
        content: '',
        status: '-1',
        size: 20,
        page: 1,
      },
    };
  },
  methods: {
    handleFilter() {
      this.$emit('submit-form', this.formInline);
    },
    selfResetForm(formname) {
      this.resetForm(formname);
      this.handleFilter();
    },
  },
};
</script>

<style scoped>

</style>
